<?php
require_once "validacao.php";

//Evitando cache de arquivo
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');
header("Cache: no-cache");
header('Expires: 0');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>.: Pizzaria Massa Mia - A Melhor Pizza da Cidade :.</title>
		<meta name="keywords" content="pizza, pizzaria, delyvery, calabreza, mussarela" />
		<meta name="description" content="Pizzaria Massa Mia, as melhores pizzas da região metropolitana do Recife!" />
		<link href="styles/style.css" rel="stylesheet" type="text/css" />
		<script language="javascript" src="lib/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script language="javascript" src="lib/jquery.cycle.all.js" type="text/javascript"></script>
		<script language="javascript" src="lib/jquery.maskedinput-1.3.min.js" type="text/javascript"></script>
		<script language="javascript" type="text/javascript">
			$(document).ready(function() {
				$('.imgs').cycle({
					fx : 'fade',
					speed : 2000
				});
				
				$('a#mostrarpedido').click(function(){
					$('#detalhe').show('fast');
					$('#framedetalhe').attr('src', 'meu_pedido.php');
				})
	
				$('#fechar').click(function(){
					$('#detalhe').hide('fast');
				})
			});

		</script>
	</head>
	<body>
		<div id="container">
			<div id="header_section">
				<?php
				if (isset($_SESSION["email"])) {
					echo "
						<div id='clientebox'>
						Bem vindo(a),<br />
						" . $_SESSION["nome"] . "<br /><br />
						<a id='mostrarpedido' href='#' onclick='return false;'>MEU PEDIDO</a>&nbsp;|&nbsp;<a href='logout.php'>SAIR</a>
						</div>
						";
										} else {
											echo "
						<div id='loginbox'>
							<form id='formlogin' action='index.php' method='post'>
								<table>
									<tr>
										<td> Email: </td>
										<td>
											<input type='text' name='email' id='email' style='width: 140px;'/>
										</td>
										<td></td>
									</tr>
									<tr>
										<td> Senha: </td>
										<td>
											<input type='password' name='senha' style='width: 140px;' />
										</td>
										<td>
											<input type='submit' value='OK' style='width: 40px;' onsubmit='return validaCampo(); return false;'/>
										</td>
									</tr>
								</table>
								Ainda n&atilde;o &eacute; cadastrado? <a href='index.php?module=cadastro'>Cadastre-se!</a>
							</form>
						</div>
					";
				}
				?>
			</div>
			<div id="menu_bg">
				<div id="menu">
					<ul>
						<li>
							<a href="index.php" class="current">P&aacute;gina Inicial</a>
						</li>
						<li>
							<a href="index.php?module=sobre">Quem Somos</a>
						</li>
						<li>
							<a href="index.php?module=cardapio">Card&aacute;pio</a>
						</li>
					</ul>
					<span class="delivery">Delivery 3301-3131</span>
				</div>
			</div>
			<?php
			if (isset($_GET['module'])) {
				switch ($_GET['module']) {
					case "sobre" :
						include "sobre.html";
						break;
					case "cardapio" :
						include "cardapio.php";
						break;
					case "cadastro" :
						include "cadastro_cliente.html";
						break;
				}
			} else {
				include "home.html";
			}
			?>
			<div id="container_end"></div>
		</div>
		<div id="footer">
			<div class="top">
				<a href="index.php">Home</a> | <a href="index.php?module=quemsom">Quem Somos</a> | <a href="index.php?module=cardapio">Cardapio</a>
				<div class="middle">
					Copyright © 2011 - Pizzaria Massa Mia
				</div>
			</div>
			<div id="detalhe">
				<div class='topbar'>
					Detalhes do Pedido<a id='fechar' href='#'><img src='images/stop16.gif' alt='Fechar' /></a>
				</div>
				<iframe id="framedetalhe" src="">
					<p>
						Seu navegador não suporta iframes.
					</p>
				</iframe>
			</div>
	</body>
	</body>
</html>